package com.example.demo.mapper;

import com.example.demo.entity.Shop;
import com.example.demo.entity.Shop1;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ShopMapper {
    @Insert("insert into shop(CustomerId,BookId,OrderNumber,Money) values(#{CustomerId},#{BookId},#{OrderNumber},#{Money})")
    void insertShop(Shop shop);

    @Select("select ShopId,CustomerId,shop.BookId,OrderNumber,Money,BookName from shop join book on shop.BookId=book.BookId where CustomerId=#{id}")
    List<Shop1> selectShop1(String id);

    @Delete("delete from shop where ShopId=#{id}")
    void deleteShop1(String id);

    @Select("select * from shop where ShopId=#{id}")
    Shop selectShop(String id);


}
